import React, { Component,lazy,Suspense } from 'react';
import '../styles/Index.scss'
import Tater from '../components/Tater';
import {Route,Redirect,Switch} from 'react-router-dom'

var Baocuo=lazy(()=>import('../components/Baocuo'))
var Shouye=lazy(()=>import('./Shouye'))
var Kecheng=lazy(()=>import('./Kecheng'))
var Wude=lazy(()=>import('./Wude'))


class Index extends Component {
   
    render() {
        return (
            <div className='index'>
               <Suspense fallback={<div  className='loading'><img src="https://hbimg.b0.upaiyun.com/42c725b3935a1ce3e32897b9995c1b6a2e921d335690-Ck6vZO_fw658" alt="" /></div>}>
          <Switch>
            <Route path="/index/shouye" component={Shouye} />
            <Route path="/index/kecheng" component={Kecheng} />
            <Route path="/index/wude" component={Wude} />
            <Redirect exact from='/index' to="/index/shouye" />
            <Route exact path="*" component={Baocuo} />
          </Switch>
        </Suspense>
                <Tater></Tater>
            </div>
        );
    }
}

export default Index;